//
//  PublishTitleView.swift
//  SinaWeiBo
//
//  Created by ZKJ on 2017/9/21.
//  Copyright © 2017年 ZKJ. All rights reserved.
//

import UIKit
import SnapKit

class PublishTitleView: UIView {
    
    // MARK:- 懒加载属性
    fileprivate lazy var titleLabel : UILabel = UILabel()
    fileprivate lazy var nickNameLabel : UILabel = UILabel()
    
    // MARK:- 构造函数
    override init(frame: CGRect) {
        super.init(frame: frame)
        setUpUI()
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
}

// MARK:- 布局UI界面
extension PublishTitleView {
    fileprivate func setUpUI() {
        
        titleLabel.font = UIFont.boldSystemFont(ofSize: 16)
        titleLabel.text = "发微博"
        addSubview(titleLabel)
        titleLabel.snp.makeConstraints { (make) in
            make.centerX.equalTo(self)
            make.top.equalTo(self)
        }
        
        nickNameLabel.font = UIFont.systemFont(ofSize: 13)
        nickNameLabel.textColor = UIColor.lightGray
        nickNameLabel.text = UserInfoViewModel.sharInstance.userInfo?.name
        addSubview(nickNameLabel)
        nickNameLabel.snp.makeConstraints { (make) in
            make.centerX.equalTo(self)
            make.top.equalTo(titleLabel.snp.bottom).offset(3)
        }
    }
}
